﻿Imports DTO
Public Class DichVu_DAL
    Dim connect As Connection
    Dim stringCommand As String
    Dim dichVu As DichVu
    Dim ds_DichVu As List(Of DichVu)

    Public Function LoadData() As List(Of DichVu)
        connect = New Connection()
        stringCommand = "Select * From DichVu"
        ds_DichVu = New List(Of DichVu)
        Dim dt As New DataTable()
        dt = connect.LoadData(stringCommand)
        For i As Integer = 0 To dt.Rows.Count - 1
            Dim id As Integer = dt.Rows(i)(0)
            Dim tenDichVu As String = dt.Rows(i)(1).ToString()
            Dim gia As Double = dt.Rows(i)(2)
            dichVu = New DichVu(id, tenDichVu, gia)
            ds_DichVu.Add(dichVu)
        Next
        Return ds_DichVu
    End Function
End Class
